package Plugin
{
	import Easing.Linear;

	public class TweenPlugin extends GamePlugin
	{
		public var duration:int=0;
		
		public var finishCallBack:Function;
		
		public var easeing:Function;
		
		public var delay:int=0;
		
		protected var time:int=0;
		
		public function TweenPlugin()
		{
			super();
			easeing=Linear.ease;
		}
		
		override protected function $update():void
		{
			super.$update();
			if(ticks>delay)
			{
				time=ticks-delay;
			}
			if(time==duration&&duration>0)
			{
				if(finishCallBack)
				{
					finishCallBack();
				}
				remove();
			}
		}
	}
}